require 'rexml/document'
require 'html/xmltree'

miss =  []
count = 0

BlogspotCrawl.find_each(:conditions => "status = 200") {|c|
  parser = HTMLTree::XMLParser.new false, true
  begin
    parser.feed c.body  
  rescue REXML::ParseException => e
    # continue with a partial prased document
    p e
  end
  
  iframe = REXML::XPath.match parser.document.root, '//iframe[@id = "injected-iframe"]'
  if iframe.length == 1 then
    miss << c.id
    p c
  end
  
  count += 1
  p count if count % 100 == 0
}
